package Strategy_Pattern.List;

import java.util.Scanner;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class Client {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);

        System.out.println("输入一列数字，以空格隔开");
        String[] a=input.nextLine().split(" ");

        int[] b=new int[a.length];
        for(int i=0;i<a.length;i++){
            b[i]=Integer.parseInt(a[i]);
        }
        Lists lists=new Lists();
        Sort sort;
        lists.setArr(b);
        System.out.println("选择排序选1，冒泡排序选2");
        int m = input.nextInt();

        if(m==1){
            sort=new Select_sort();
            lists.setSort(sort);
            lists.play();
        }
        else if(m==2){
            sort=new Bubble_sort();
            lists.setSort(sort);
            lists.play();
        }
        else {
            System.out.println("输入错误");
        }

    }
}
